#ifndef __FILEWORKER_H_
#define __FILEWORKER_H_

typedef struct
{
    char *filePath;
    long offset;
    int sockfd;
    char *clientId;
} FileBody;

//文件处理 worker 函数声明
//处理文件头
void process_up_filehead(int sockfd, char *msg, char *clientId);
//回复头信息
void reply_up_filehead(int sockfd, char *file_path, char *msg, char *clientId, int result_code);
//处理文件信息
void process_up_file(int sockfd, char *clientId, char *msg, char *data);
//上传完成恢复
void reply_upfile_end(int sockfd, char *clientId, char *file_name);
//处理下载文件头
void process_down_head(int sockfd, char *clientId, char *msg);
//处理下载文件信息
void process_down_file(int sockfd, char *clientId, char *msg);
//发送下载文件头信息
void send_down_filehead(int sockfd, char *clientId, char *filename, long totalsize, int result_code);
//发送下载文件信息
void send_down_file(int sockfd, char *clientId, char *filepath, long offset);
//发送具体数据
int send_fileinfo(int sockfd, char *clientId, FileInfo *fileInfo);
//处理文件下载
void *send_filebody(void *args);

#endif